/* User icons styles */
.user-icons {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.user-icons a {
    text-decoration: none;
    color: #2c3e50;
}

.user-icons i {
    font-size: 28px;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.user-icons i:hover {
    transform: scale(1.1);
    color: #d4757a;
}

.order-history-page {
    padding: 10px 20px 60px;
    min-height: 100vh;
    background: #f8f9fa;
}

.order-history-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.order-history-container h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 40px;
    font-weight: 600;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #d4757a;
    color: #d4757a;
}

.filter-btn.active {
    background: #d4757a;
    border-color: #d4757a;
    color: white;
}

.search-bar {
    position: relative;
    max-width: 400px;
    margin: 0 auto 40px;
    width: 100%;
    padding: 0 15px;
}

.search-bar input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: #d4757a;
}

.search-bar i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.order-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.order-header {
    background: linear-gradient(135deg, #d4757a 0%, #b85d62 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-id {
    font-size: 18px;
    font-weight: 600;
}

.order-date {
    font-size: 14px;
    opacity: 0.9;
}

.order-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.order-status.pending {
    background: #f39c12;
    color: white;
}

.order-status.confirmed {
    background: #3498db;
    color: white;
}

.order-status.delivered {
    background: #27ae60;
    color: white;
}

.order-status.cancelled {
    background: #e74c3c;
    color: white;
}

.order-status.to_pay {
    background: #f39c12;
    color: white;
}

.order-content {
    padding: 20px;
}

.order-items {
    margin-bottom: 20px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.order-item:last-child {
    border-bottom: none;
}

.item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.item-quantity {
    color: #666;
    font-size: 14px;
}

.item-price {
    font-weight: 600;
    color: #d4757a;
}

.order-summary {
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
}

.summary-row.total {
    font-weight: 600;
    font-size: 16px;
    color: #d4757a;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.order-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: #d4757a;
    color: white;
}

.btn-primary:hover {
    background: #b85d62;
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.page-btn {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    background: white;
    color: #2c3e50;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: #f8f9fa;
}

.page-btn.active {
    background: #d4757a;
    color: white;
    border-color: #d4757a;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.empty-orders {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #666;
}

.empty-orders i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-orders h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.empty-orders p {
    font-size: 16px;
    margin-bottom: 30px;
}

.empty-orders .btn {
    margin: 0 auto;
}


@media (max-width: 768px) {
    .order-history-container h1 {
        font-size: 2rem;
    }

    .filters {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .orders-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .order-header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .order-status {
        position: static;
        align-self: flex-end;
    }

    .order-content {
        padding: 15px;
    }

    .order-item {
        gap: 10px;
    }

    .item-image {
        width: 50px;
        height: 50px;
    }

    .order-actions {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .order-history-page {
        padding: 100px 10px 40px;
    }

    .order-history-container {
        padding: 0 10px;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-btn {
        text-align: center;
    }

    .search-bar {
        max-width: 70%;
        margin-left: 5%;
    }
}


.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(212, 117, 122, 0.3);
    border-radius: 50%;
    border-top-color: #d4757a;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


.order-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.order-modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.order-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #d4757a 0%, #b85d62 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.order-modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: white;
    padding: 5px;
    line-height: 1;
}

.order-modal-body {
    padding: 30px 30px 50px 30px;
}

.order-detail-section {
    margin-bottom: 25px;
}

.order-detail-section h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 2px solid #d4757a;
    padding-bottom: 5px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #666;
}

.detail-value {
    color: #2c3e50;
}

.order-timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-left: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d4757a;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: -20px;
    top: 15px;
    width: 2px;
    height: calc(100% + 10px);
    background: #e0e0e0;
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.timeline-status {
    font-weight: 600;
    color: #2c3e50;
}

.timeline-note {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

